package com.xx.job.common;

import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
public class PageResult<T> implements Serializable {

    private Long count;

    private List<T> list;

    private Long pageIndex;

    private Long pageSize;


    public PageResult(IPage<T> page) {
        this.count = page.getTotal();
        this.list = page.getRecords();
        this.pageIndex = page.getCurrent();
        this.pageSize = page.getSize();
    }

}
